package com.ebeijia.service.admin.impl;

import com.ebeijia.context.RequestResponseContext;
import com.ebeijia.mybatis.mapper.ComplaintSuggInfoMapper;
import com.ebeijia.mybatis.pojo.ComplaintSuggInfo;
import com.ebeijia.query.SuggInfoQuery;
import com.ebeijia.service.admin.ComplaintSuggInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by YPJ on 2016/5/17.
 */
@Service
public class ComplainSuggInfoServiceImpl implements ComplaintSuggInfoService {
    @Resource
    private ComplaintSuggInfoMapper complaintSuggInfoMapper;
    @Override
    public List<ComplaintSuggInfo> queryProSuggest(SuggInfoQuery suggInfoQuery) {
        return complaintSuggInfoMapper.queryProSuggest(suggInfoQuery);
    }

    @Override
    public int queryProSuggestCount(SuggInfoQuery suggInfoQuery) {
        return complaintSuggInfoMapper.queryProSuggestCount(suggInfoQuery);
    }

    @Override
    public int applyCom(ComplaintSuggInfo complaintSuggInfo) {
        complaintSuggInfo.setReplyOpr(RequestResponseContext.getUserContext().getAccount());
        complaintSuggInfo.setBusiStatus("02");
        return complaintSuggInfoMapper.updateByPrimaryKeySelective(complaintSuggInfo);
    }
}
